package com.example.myapplication.util;

/**
 * @author ：xiongwei
 * @date ：Created in 2021/7/18 20:56
 */
public class RandomUtil {

    public static Integer getRandom10TO99() {
        int max = 99, min = 10;
        return getRandom(max, min);
    }

    public static Integer getRandom1000TO999() {
        int max = 9999, min = 1000;
        return getRandom(max, min);
    }

    public static Integer getRandom10000TO9999() {
        int max = 99999, min = 10000;
        return getRandom(max, min);
    }

    public static Integer getRandom(int max, int min) {
        return (int) (Math.random() * (max - min) + min);
    }

}
